import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
  // mode: 'history',
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    // 这里开始的路径是有用的
    {
      path: '/login',
      name: 'login',
      component: () => import('./views/Organization/Login')
    },
    {
      path: '/chooseport',
      name: 'chooseport',
      component: () => import('./views/ChoosePort')
    },
    // 组织端路由
    {
      path: '/baseurl',
      name: 'baseurl',
      component: () => import('./views/Organization/BaseURL'),
      children: [// 配置子路由
        {
          path: 'index',
          name: 'index',
          component: () => import('./views/Organization/Index.vue'),
          meta: {
            footChoose: 'index'
          }
        },
        {
          path: 'file',
          name: 'file',
          component: () => import('./views/Organization/File.vue'),
          meta: {
            footChoose: 'file'
          }
        },
        {
          path: 'mine',
          name: 'mine',
          component: () => import('./views/Organization/Mine.vue'),
          meta: {
            footChoose: 'mine'
          }
        },
        {
          path: 'tip_operation',
          name: 'tip_operation',
          component: () => import('./components/public/tip_operation.vue'),
          meta: {
            // 显示提交成功的时候
            footChoose: ''
          }
        },
        {
          path: 'uploadopinion',
          name: 'uploadopinion',
          component: () => import('./views/Organization/UploadOpinion.vue')
        },
        {
          path: 'excelview',
          name: 'excelview',
          component: () => import('./views/Organization/ExcelView')
        }
      ]
    },
    // 个人端路由
    {
      path: '/stbaseurl',
      name: 'stbaseurl',
      component: () => import('./views/Student/STBaseURL.vue'),
      children: [
        {
          path: 'index',
          name: 'stindex',
          component: () => import('./views/Student/indexPage/index.vue'),
          meta: {
            footChoose: 'index'
          }
        },
        {
          path: 'file',
          name: 'stfile',
          component: () => import('./views/Student/filePage/STFile.vue'),
          meta: {
            footChoose: 'file'
          }
        },
        {
          path: 'mine',
          name: 'stmine',
          component: () => import('./views/Student/minePage/STmine.vue'),
          meta: {
            footChoose: 'mine'
          }
        },
        {
          path: 'feedback',
          component: () => import('./views/Organization/UploadOpinion.vue')
        }
      ]
    },
    // 学院端路由
    {
      path: '/baseurl2',
      name: 'baseurl2',
      component: () => import('./views/Examine/BaseURL2'),
      children: [
        {
          path: 'index',
          name: 'Eindex',
          component: () => import('./views/Examine/Index2.vue'),
          meta: {
            footChoose: 'Eindex'
          },
          children: [
            {
              path: 'exam/:type',
              name: 'Eexam',
              component: () => import('./views/Examine/Index2Exam/Exam.vue'),
              meta: {
                footChoose: 'Eindex'
              }
            },
            {
              path: 'appeal',
              name: 'appeal',
              component: () => import('./views/Examine/Index2Exam/EApeal.vue'),
              meta: {
                footChoose: 'Eindex'
              }
            },
            {
              path: '',
              redirect: 'appeal'
            }
          ]
        },
        {
          path: 'file',
          name: 'Efile',
          component: () => import('./views/Examine/File2.vue'),
          meta: {
            footChoose: 'Efile'
          },
          children: [
            {
              path: 'nopass',
              name: 'Enopass',
              component: () => import('./views/Examine/File2Route/NoPass.vue'),
              meta: {
                footChoose: 'Efile'
              }
            },
            {
              path: 'passed',
              name: 'Epassed',
              component: () => import('./views/Examine/File2Route/Passed.vue'),
              meta: {
                footChoose: 'Efile'
              }
            }
          ]
        },
        {
          path: 'mine',
          name: 'Emine',
          component: () => import('./views/Examine/Mine2.vue'),
          meta: {
            footChoose: 'Emine'
          }
        },
        {
          path: 'welcome',
          name: 'Ewelcome',
          component: () => import('./views/Examine/Welcome.vue')
        },
        {
          path: '',
          redirect: 'Welcome'
        }
      ]
    },
    {
      path: '/uploadprove',
      name: 'uploadprove',
      component: () => import('./views/Organization/UploadProve.vue')
    },
    // 管理员端路由
    {
      path: '/admin',
      name: 'admin',
      component: () => import('./views/Admin/Index'),
      children: [// 配置子路由
        {
          path: 'opinion',
          name: 'opinion',
          component: () => import('./views/Admin/Opinion.vue')
        },
        {
          path: 'user',
          name: 'user',
          component: () => import('./views/Admin/User.vue')
        },
        {
          path: 'examer',
          name: 'examer',
          component: () => import('./views/Admin/Examer.vue')
        },
        {
          path: 'organizationUploader',
          name: 'organizationUploader',
          component: () => import('./views/Admin/OrganizationUploader.vue')
        },
        {
          path: 'item',
          name: 'item',
          component: () => import('./views/Admin/Item.vue')
        }
      ]
    },
    //  测试用
    {
      path: '/test',
      component: () => import('./views/Student/test.vue')
    },
    { // lyl上传规则
      path: '/upload',
      name: 'Eupload',
      component: () => import('./views/Examine/UploadRelu.vue')
    },
    { // lyl 常用加分项管理
      path: '/emanage',
      name: 'Emanage',
      component: () => import('./views/Examine/Manage.vue')
    },
    {
      path: '/Eoptinion',
      name: 'Eoptinion',
      component: () => import('./views/Examine/Opinion.vue')
    }
  ]
})
